#include "FactorySimpleM.h"
std::map<EnumCar, OnCreate> FactorySimpleM::m_mapCar;

FactorySimpleM::FactorySimpleM()
{
    
}

//创建车;
InterfaceCar* FactorySimpleM::CreateCar(EnumCar emType)
{
    OnCreate pCreate = m_mapCar[emType];
    if (nullptr != pCreate)
    {
        return (pCreate)();
    }
    return nullptr;
}

//注册车类创建函数指针;
void FactorySimpleM::RegisterCarCreate(EnumCar emType, OnCreate create)
{
    m_mapCar[emType] = create;
}

